import { instance } from "../utils/request";
const getErrorLogsPagination = async (page:number,limit:number,key?:string) => {
	return await instance.get("/ErrorLogs/Pagination", {page,limit,key});
};

const addErrorLogs = async (data:RequestCreateErrorLogsDto) => {
	return await instance.post("/ErrorLogs/Add", data);
};

const updateErrorLogs = async (data:RequestUpdateErrorLogsDto) => {
	return await instance.post("/ErrorLogs/Update", data);
};

const getErrorLogsDetail = async (id:number) => {
	return await instance.get("/ErrorLogs/Detail", { id  });
};

const deleteErrorLogs = async (data:RequestIdErrorLogsDto) => {
	return await instance.post("/ErrorLogs/Delete", data);
};

const ErrorLogsApi = {
	getErrorLogsPagination,
	addErrorLogs,
	updateErrorLogs,
	getErrorLogsDetail,
	deleteErrorLogs,
};

export default ErrorLogsApi
